<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>SPHinXsys: SPHINXsys/src/for_2D_build/geometries/geometry.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">SPHinXsys
   &#160;<span id="projectnumber">alpha version</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_3dc1dabd28ba78e072d14d3fcfc90454.html">SPHINXsys</a></li><li class="navelem"><a class="el" href="dir_48ea983704c43b6d88c1fa3f4d09e369.html">src</a></li><li class="navelem"><a class="el" href="dir_9ca3159e53ba4d8edf6cf759982bc449.html">for_2D_build</a></li><li class="navelem"><a class="el" href="dir_36ebca7d0f8fa30fe00c82b25479f485.html">geometries</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">geometry.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="for__2_d__build_2geometries_2geometry_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160; </div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="preprocessor">#pragma once</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160; </div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="preprocessor">#define _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING</span></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160; </div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment">//boost library</span></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="preprocessor">#include &lt;boost/geometry.hpp&gt;</span></div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="preprocessor">#include &lt;boost/geometry/geometries/point_xy.hpp&gt;</span></div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="preprocessor">#include &lt;boost/geometry/geometries/polygon.hpp&gt;</span></div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="preprocessor">#include &lt;boost/geometry/geometries/adapted/boost_tuple.hpp&gt;</span></div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="preprocessor">#include &lt;boost/geometry/strategies/transform.hpp&gt;</span></div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="preprocessor">#include &lt;boost/geometry/strategies/transform/matrix_transformers.hpp&gt;</span></div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160; </div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="preprocessor">#include &quot;base_data_package.h&quot;</span></div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="base__geometry_8h.html">base_geometry.h</a>&quot;</span></div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160; </div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="preprocessor">#include &lt;iostream&gt;</span></div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="preprocessor">#include &lt;string&gt;</span></div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="preprocessor">#include &lt;fstream&gt;</span></div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160; </div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian)</div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160; </div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="keyword">using namespace </span>boost::geometry;</div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160; </div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespace_s_p_h.html">SPH</a> {</div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160; </div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;    <span class="keyword">class </span>Kernel;</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160; </div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;    <span class="keyword">typedef</span> model::polygon&lt;model::d2::point_xy&lt;Real&gt;&gt; boost_poly;</div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;    <span class="keyword">typedef</span> model::multi_polygon&lt;boost_poly&gt; boost_multi_poly;</div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160; </div>
<div class="line"><a name="l00050"></a><span class="lineno"><a class="line" href="class_s_p_h_1_1_multi_polygon.html">   50</a></span>&#160;    <span class="keyword">class </span><a class="code" href="class_s_p_h_1_1_multi_polygon.html">MultiPolygon</a> : <span class="keyword">public</span> <a class="code" href="class_s_p_h_1_1_shape.html">Shape</a></div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;    {</div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;    <span class="keyword">public</span>:</div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;        <a class="code" href="class_s_p_h_1_1_multi_polygon.html">MultiPolygon</a>() :<a class="code" href="class_s_p_h_1_1_shape.html">Shape</a>(<span class="stringliteral">&quot;MultiPolygon&quot;</span>) {};</div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;        boost_multi_poly&amp; getBoostMultiPoly() { <span class="keywordflow">return</span> multi_poly_; };</div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;        <span class="keywordtype">bool</span> checkContain(Vec2d pnt, <span class="keywordtype">bool</span> BOUNDARY_INCLUDED = <span class="keyword">true</span>);</div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;        Vec2d findClosestPoint(Vec2d&amp; input_pnt);</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;        <span class="keyword">virtual</span> <a class="code" href="namespace_s_p_h.html#ad185cdeb05bdee76bf975cc50f1c15b7">BoundingBox</a> findBounds() <span class="keyword">override</span>;</div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160; </div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;        <span class="keywordtype">void</span> addAMultiPolygon(<a class="code" href="class_s_p_h_1_1_multi_polygon.html">MultiPolygon</a>&amp; multi_polygon, <a class="code" href="class_shape_boolean_ops.html">ShapeBooleanOps</a> op);</div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;        <span class="keywordtype">void</span> addABoostMultiPoly(boost_multi_poly&amp; boost_multi_poly, <a class="code" href="class_shape_boolean_ops.html">ShapeBooleanOps</a> op);</div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;        <span class="keywordtype">void</span> addAPolygon(std::vector&lt;Vecd&gt;&amp; points, <a class="code" href="class_shape_boolean_ops.html">ShapeBooleanOps</a> op);</div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;        <span class="keywordtype">void</span> addACircle(Vec2d center, Real radius, <span class="keywordtype">int</span> resolution, <a class="code" href="class_shape_boolean_ops.html">ShapeBooleanOps</a> op);</div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160; </div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;    <span class="keyword">protected</span>:</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;        boost_multi_poly multi_poly_;</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;        boost_multi_poly MultiPolygonByBooleanOps(boost_multi_poly multi_poly_in,</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;                        boost_multi_poly multi_poly_op, <a class="code" href="class_shape_boolean_ops.html">ShapeBooleanOps</a> boolean_op);</div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;    };</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160; </div>
<div class="line"><a name="l00074"></a><span class="lineno"><a class="line" href="class_s_p_h_1_1_complex_shape.html">   74</a></span>&#160;    <span class="keyword">class </span><a class="code" href="class_s_p_h_1_1_complex_shape.html">ComplexShape</a> : <span class="keyword">public</span> <a class="code" href="class_s_p_h_1_1_shape.html">Shape</a></div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;    {</div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;        Vec2d findClosestPoint(Vec2d&amp; input_pnt);</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;    <span class="keyword">public</span>:</div>
<div class="line"><a name="l00079"></a><span class="lineno"><a class="line" href="class_s_p_h_1_1_complex_shape.html#af9172c77de9ac21119b3d1db17cae6fe">   79</a></span>&#160;        <a class="code" href="class_s_p_h_1_1_complex_shape.html#af9172c77de9ac21119b3d1db17cae6fe">ComplexShape</a>() : <a class="code" href="class_s_p_h_1_1_shape.html">Shape</a>(<span class="stringliteral">&quot;ComplexShape&quot;</span>), multi_ploygen_() {};</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;        <a class="code" href="class_s_p_h_1_1_complex_shape.html">ComplexShape</a>(std::string complex_shape_name) : <a class="code" href="class_s_p_h_1_1_shape.html">Shape</a>(complex_shape_name), multi_ploygen_() {};</div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;        <span class="keyword">virtual</span> ~ComplexShape() {};</div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;        <span class="keyword">virtual</span> <a class="code" href="namespace_s_p_h.html#ad185cdeb05bdee76bf975cc50f1c15b7">BoundingBox</a> findBounds() <span class="keyword">override</span>;</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;        <span class="keywordtype">void</span> addAMultiPolygon(MultiPolygon&amp; multi_polygon, <a class="code" href="class_shape_boolean_ops.html">ShapeBooleanOps</a> op);</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;        <span class="keywordtype">void</span> addABoostMultiPoly(boost_multi_poly&amp; boost_multi_poly, <a class="code" href="class_shape_boolean_ops.html">ShapeBooleanOps</a> op);</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;        <span class="keywordtype">void</span> addAPolygon(std::vector&lt;Vecd&gt;&amp; points, <a class="code" href="class_shape_boolean_ops.html">ShapeBooleanOps</a> op);</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;        <span class="keywordtype">void</span> addACircle(Vec2d center, <a class="code" href="class_real.html">Real</a> radius, <span class="keywordtype">int</span> resolution, <a class="code" href="class_shape_boolean_ops.html">ShapeBooleanOps</a> op);</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;        <span class="keywordtype">void</span> addAPolygonFromFile(std::string file_path_name, <a class="code" href="class_shape_boolean_ops.html">ShapeBooleanOps</a> op, Vec2d translation = <a class="code" href="class_vecd.html">Vecd</a>(0), <a class="code" href="class_real.html">Real</a> scale_factor = 1.0);</div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160; </div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;        <span class="keyword">virtual</span> <span class="keywordtype">bool</span> checkContain(Vec2d&amp; input_pnt, <span class="keywordtype">bool</span> BOUNDARY_INCLUDED = <span class="keyword">true</span>);</div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;        <span class="keyword">virtual</span> <span class="keywordtype">bool</span> checkNotFar(Vec2d&amp; input_pnt, <a class="code" href="class_real.html">Real</a> threshold);</div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;        <span class="keyword">virtual</span> <span class="keywordtype">bool</span> checkNearSurface(Vec2d&amp; input_pnt, <a class="code" href="class_real.html">Real</a> threshold);</div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;        <span class="keyword">virtual</span> <a class="code" href="class_real.html">Real</a> findSignedDistance(Vec2d&amp; input_pnt);</div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;        <span class="keyword">virtual</span> Vec2d findNormalDirection(Vec2d&amp; input_pnt);</div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;    <span class="keyword">protected</span>:</div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;        MultiPolygon multi_ploygen_;</div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;    };</div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;}</div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160; </div>
</div><!-- fragment --></div><!-- contents -->
<div class="ttc" id="aclass_vecd_html"><div class="ttname"><a href="class_vecd.html">Vecd</a></div></div>
<div class="ttc" id="abase__geometry_8h_html"><div class="ttname"><a href="base__geometry_8h.html">base_geometry.h</a></div><div class="ttdoc">Shape is the base class for all geometries.</div></div>
<div class="ttc" id="aclass_s_p_h_1_1_complex_shape_html_af9172c77de9ac21119b3d1db17cae6fe"><div class="ttname"><a href="class_s_p_h_1_1_complex_shape.html#af9172c77de9ac21119b3d1db17cae6fe">SPH::ComplexShape::ComplexShape</a></div><div class="ttdeci">ComplexShape()</div><div class="ttdef"><b>Definition:</b> geometry.h:79</div></div>
<div class="ttc" id="aclass_shape_boolean_ops_html"><div class="ttname"><a href="class_shape_boolean_ops.html">ShapeBooleanOps</a></div><div class="ttdoc">Boolian operation for generate complex shapes.</div><div class="ttdef"><b>Definition:</b> base_geometry.h:41</div></div>
<div class="ttc" id="anamespace_s_p_h_html_ad185cdeb05bdee76bf975cc50f1c15b7"><div class="ttname"><a href="namespace_s_p_h.html#ad185cdeb05bdee76bf975cc50f1c15b7">SPH::BoundingBox</a></div><div class="ttdeci">std::pair&lt; Vecd, Vecd &gt; BoundingBox</div><div class="ttdef"><b>Definition:</b> sph_data_conainers.h:19</div></div>
<div class="ttc" id="aclass_s_p_h_1_1_multi_polygon_html"><div class="ttname"><a href="class_s_p_h_1_1_multi_polygon.html">SPH::MultiPolygon</a></div><div class="ttdoc">used to define a closed region</div><div class="ttdef"><b>Definition:</b> geometry.h:50</div></div>
<div class="ttc" id="aclass_real_html"><div class="ttname"><a href="class_real.html">Real</a></div></div>
<div class="ttc" id="anamespace_s_p_h_html"><div class="ttname"><a href="namespace_s_p_h.html">SPH</a></div><div class="ttdef"><b>Definition:</b> solid_body_supplementary.cpp:9</div></div>
<div class="ttc" id="aclass_s_p_h_1_1_complex_shape_html"><div class="ttname"><a href="class_s_p_h_1_1_complex_shape.html">SPH::ComplexShape</a></div><div class="ttdoc">gives the final geomtrical definition of the SPHBody</div><div class="ttdef"><b>Definition:</b> geometry.h:74</div></div>
<div class="ttc" id="aclass_s_p_h_1_1_shape_html"><div class="ttname"><a href="class_s_p_h_1_1_shape.html">SPH::Shape</a></div><div class="ttdoc">Base class for all geometries.</div><div class="ttdef"><b>Definition:</b> base_geometry.h:54</div></div>
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.17
</small></address>
</body>
</html>
